package cn.kongwg.boot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kongwg
 * @create 2021-03-25 22:54
 */
@RestController
public class RedisController {

    @Autowired
    RedisTemplate redisTemplate;

    @RequestMapping("/hello")
    public String hello(){
        ValueOperations value = redisTemplate.opsForValue();
        value.set("user","kongwg");
        return "ok";
    }
}
